<template>
	<view class="index-content">
		<!-- 首页轮播-->
		<!-- <view class="swiper" style="background: white;" v-if="banners.length>0">
			<swiper class="swiper-container" :autoplay="true" :interval="4000" :circular="true" :indicator-dots="true"
			 indicator-active-color="#FC3F78" indicator-color="#cccccc"
			  style="height: 420rpx;padding: 18rpx 16rpx 16rpx 18rpx;
			  ">
				<block v-for="(item, index3) in banners" :key="index3" class="tabnav">
					<swiper-item class="swiper-wrapper">
						<image @tap="toGoodsInfos(item.itemid)" :src="item.itempic" 
						style="width: 100%;height: 380upx;border-radius: 15rpx;" mode="scaleToFill"></image>
					</swiper-item>
				</block>
			</swiper>
		</view> -->
		<!-- 文字轮播 -->
		<!-- <view style="padding: 10rpx 16rpx 10rpx 16rpx;">
		   <view class="tabnav" style="border-radius: 15rpx;width: 100%;height: 100rpx;">
		   	<swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
		   		<block v-for="(item,index) in msgList" :key="index">
		   			
		   			<swiper-item>
		   				<view style="display: flex;flex: 13;padding-top: 15rpx;padding-bottom: 10rpx;">
		   					<view style="flex: 2;text-align: center;font-size: 40rpx;color: red;position: relative;top: 15rpx;" class="iconfont">&#xe61d;</view>
		   					<view style="flex: 11;line-height: 73rpx;" class="swiper_item">{{item.title}}</view>
		   				</view>
		   				
		   			</swiper-item>
		   			
		   		</block>
		   	</swiper>
		   </view>
	   </view> -->


		<!-- 导航条 -->
		<view style="padding: 10rpx 16rpx 16rpx 18rpx;background-color: white;">
			<view class="navts tabnav" style="padding-top: 15rpx;border: 0px solid #BBBBBB;">
				<view class="navts-v" @click="tabNavts(1)">
					<view class="navts-v-v iconfont" style="color: rgb(60, 132, 253);">&#xe647;</view>
					<view class="navts-v-v iconfont" style="">通知公告</view>
				</view>
				<view class="navts-v" @click="tabNavts(2)">
					<view class="navts-v-v iconfont" style="color: rgb(251, 195, 50);">&#xe605;</view>
					<view class="navts-v-v iconfont" style="">消息提醒</view>
				</view>
				<view class="navts-v" @click="tabNavts(3)">
					<view class="navts-v-v iconfont" style="color: rgb(17, 200, 106);">&#xe66e;</view>
					<view class="navts-v-v iconfont" style="">待办事宜</view>
				</view>
				<view class="navts-v" @click="tabNavts(4)">
					<view class="navts-v-v iconfont" style="color: rgb(253, 117, 69);">&#xe746;</view>
					<view class="navts-v-v iconfont" style="">签到</view>
				</view>
			</view>

		</view>

		<!-- <u-button plain type="success" size='mini' @click="clickRole(item.name)"
		v-for="(item,index) in userRoleList" :key="index">{{item.name}}</u-button> -->


		<view class="swiperMain" style="padding-right: 8px;padding-left: 8px;margin-top: 20rpx;">
			<view class="swiperHead tabnav">

				<!--组件-->
				<swiperNavBar :scrollIntoView="scrollIntoView" :swiperTabList='swiperTabList' :swiperTabIdx='swiperTabIdx'
				 :currentSwiperWidth='currentSwiperWidth' :currentSwiperHeight='currentSwiperHeight' :swiperColor='swiperColor'
				 :swiperCurrentColor='swiperCurrentColor' :currentSwiperLineShow="currentSwiperLineShow"
				 :currentSwiperLineActiveWidth="currentSwiperLineActiveWidth" :currentSwiperLineActiveHeight="currentSwiperLineActiveHeight"
				 :currentSwiperLineActiveBg="currentSwiperLineActiveBg" :currentSwiperLineAnimatie="currentSwiperLineAnimatie" v-if=" swiperTabList.length > 1 "
				 @change="CurrentTab">
				</swiperNavBar>
				<!--组件-->

			</view>

			<view class="tabnav" style="width: 100%;margin-top: 20rpx;margin-bottom: 20rpx;">

				<u-avatar :class="[projectOne.id==item.id?'bigshow':'smainshow','u-avaimg']" @click="tabProject(index)" :src="item.projectImg" mode="square" 
				v-for="(item,index) in projcetList" 
				 :key='index'></u-avatar>

			</view>


			<!--内容-->
			<!-- :style="{ paddingTop:currentSwiperHeight + 'rpx' }" 原加paddingTop-->
			<view class="swiperCont" style="border: 0px solid red;">
				<!-- <swiper class="swiper" :style="{ height:mainHeight + 'px' }" :current="swiperTabIdx" @change="SwiperChange"> -->
				<swiper class="swiper" :style="{ height:mainHeight + 'rpx' }" :current="swiperTabIdx" @change="SwiperChange">
					<swiper-item class="swiperItem" v-for="(item,index) in swiperTabList" :key='index'>

						<view :class="['工程进度'==swiperShowIndex? 'show_view' : 'hide_view','projectView']">

							<view class="order tabnav " v-for="(item2,index2) in projcetList">
								<view class="top">
									<view class="left">
										<u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
										<view class="store" @click="projceClick(item2.id,index2)">{{item2.projectName}}</view>
										<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
									</view>
									<view class="right">{{item2.createDate}}</view>
								</view>
								<view class="item">
									<view class="left">
										<image :src="item2.projectImg" mode="aspectFill"></image>
									</view>
									<view class="content">
										<view class="title u-line-2">施工单位: &nbsp;{{item2.developmentOrganization}}</view>
										<view class="type">人员数量(个): &nbsp;&nbsp; {{item2.CmpMaintenancetSum}}</view>
										<view class="type">设备数量(台): &nbsp;&nbsp; {{item2.unitSum}}</view>
										<view class="type">地址: &nbsp;{{item2.projectAddress}}</view>
									</view>

									<!-- <view class="right">
											<view class="price">
												￥111
												<text class="decimal">111</text>
											</view>
											<view class="number">11</view>
										</view> -->
								</view>
								<view style="display: flex;font-size: 24rpx;text-align: center;">
									<view class="" style="flex: 1;text-align: left;">总层数 </view>
									<view class="" style="flex: 1;">已完成</view>
									<view class="" style="flex: 1;text-align: right;">预算(万)</view>
								</view>
								<view style="display: flex;font-size: 24rpx;text-align: center;margin-top: 20rpx;">
									<view class="" style="flex: 1;text-align: left;">{{item2.numberPlies}} </view>
									<view class="" style="flex: 1;">{{item2.achieveTier}}</view>
									<view class="" style="flex: 1;text-align: right;">{{item2.grossInvestment}}</view>
								</view>
								<view class="total">
									<cmd-progress :percent="item2.percents" :show-info="false"></cmd-progress>
								</view>
							</view>

						<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="projcetList.length<=0"></u-empty>
						</view>
						
						
						<view :class="['项目信息'==swiperShowIndex? 'show_view' : 'hide_view','projectView']">
						
							<view class="order tabnav " v-for="(item12,index12) in projcetList1">
								<view class="top">
									<view class="left">
										<u-icon name="home" :size="30" color="rgb(94,94,94)"></u-icon>
										<view class="store" @click="projceClick(item12.id,index12)">{{item12.projectName}}</view>
										<u-icon name="arrow-right" color="rgb(203,203,203)" :size="26"></u-icon>
									</view>
									<view class="right">{{item12.createDate}}</view>
								</view>
								<view class="item">
									<view class="left">
										<image :src="item12.projectImg" mode="aspectFill"></image>
									</view>
									<view class="content">
										<view class="title u-line-2">施工单位: &nbsp;{{item12.developmentOrganization}}</view>
										<view class="type">项目状态: &nbsp;&nbsp; {{item12.projectStart}}</view>
										<view class="type">项目预算(万): &nbsp;&nbsp; {{item12.grossInvestment}}</view>
										<view class="type">地项目概况: &nbsp;{{item12.projectOverview}}</view>
									</view>
					
								</view>
								<view class="total">
									<cmd-progress :percent="item12.percents" :show-info="false"></cmd-progress>
								</view>
							</view>
						
						<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="projcetList1.length<=0"></u-empty>
						</view>

						<view :class="['质量状况'==swiperShowIndex? 'show_view' : 'hide_view','zlzk']" style="width: 100%;">
							
							<view class="tabnav" v-for="item in qualityList" style="height: 200rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">责任人: {{item.nunciatornamelist}}</view>
									<view style="flex: 1;">检查时间: {{item.createDate.substring(0,10)}}</view>
								</view>
								<view style="padding: 10rpx;">检查项: {{item.remarks}}</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;">检查结果:  <u-button style="margin-left: 40rpx;" type="warning" shape="square" size="mini"> {{item.checkResult}}</u-button></view>
									<view style="flex: 1;">整改状态:  <u-button style="margin-left: 40rpx;" type="success" shape="square" size="mini"> {{item.handingSuggestion}}</u-button></view>
								</view>
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="qualityList.length<=0"></u-empty>
							
							
						</view>

						<view :class="['安全状况'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']"  style="width: 100%;">
							
							<view class="tabnav" v-for="item in safetyList" style="height: 200rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">责任人: {{item.dutyPersonName}}</view>
									<view style="flex: 1;">检查时间: {{item.createDate.substring(0,10)}}</view>
								</view>
								<view style="padding: 10rpx;">检查项: {{item.remarks}}</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;">检查结果:  <u-button style="margin-left: 40rpx;" type="warning" shape="square" size="mini">{{item.handingSuggestion}} </u-button></view>
									<view style="flex: 1;">整改状态:  <u-button style="margin-left: 40rpx;" type="success" shape="square" size="mini">{{item.checkRresult}} </u-button></view>
								</view>
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="safetyList.length<=0"></u-empty>
							
							
						</view>

						<view :class="['成本'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']"  style="width: 100%;">
							
							<view class="tabnav" v-for="item in costList" style="height: 250rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">合同名称: {{item.contractName}}</view>
									<view style="flex: 1;text-align: right;">编号: {{item.contractNumber}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">合同类型: {{item.contractTypeName}}</view>
									<view style="flex: 1;text-align: right;">签订时间: {{item.signingTime.substring(0,10)}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">合同金额: {{item.contractMoney}} (万)</view>
									<view style="flex: 1;text-align: right;">有效期: {{item.expirationDate}}</view>
								</view>
								<view style="padding: 10rpx;">合同备注: {{item.remarks}}</view>
								
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="costList.length<=0"></u-empty>
							
							
						</view>

						<view :class="['材料预警'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']" style="width: 100%;">
							
							
							
							<view class="tabnav" v-for="item in materialsList" style="height: 280rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;font-size: 30rpx;">材料名称: {{item.materialsName}}</view>
									<view style="flex: 3;">编号: {{item.materialsCode}}</view>
								</view>
								
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;font-size: 30rpx;">单位: {{item.materialsUnit}}</view>
									<view style="flex: 3;">价格: {{item.marketPrice}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;font-size: 30rpx;">入场时间: {{item.createDate.substring(0,10)}}</view>
									<view style="flex: 3;">预警:
									<!-- <u-tag :text="item.warningNumber" type="success" size='mini' shape="circle" /> -->
									    <u-button style="margin-left: 20rpx;" type="primary" shape="square" size="mini"> {{item.warningNumber}}%</u-button>
									</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;font-size: 30rpx;">材料数量: {{item.materialsNumber}}</view>
									<view style="flex: 3;">状态: 
									   
									   <u-button style="margin-left: 20rpx;" v-if='item.earlyWarning<(item.materialsNumber*(item.warningNumber/100))' type="warning"
										shape="square" size="mini"> 未到</u-button>
									   <u-button style="margin-left: 20rpx;" v-if='item.earlyWarning>=(item.materialsNumber*(item.warningNumber/100)) &&item.earlyWarning<=item.materialsNumber' type="success"
																			shape="square" size="mini"> 达到</u-button>
										<u-button style="margin-left: 20rpx;" v-if='item.earlyWarning>item.materialsNumber' type="error"
																													shape="square" size="mini"> 超出 </u-button>
									</view>
								</view>
								
							
							</view>
							
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="materialsList.length<=0"></u-empty>
							
						</view>

						<view :class="['材料入场'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']" style="width: 100%;">
							
							<view class="tabnav" v-for="item in menterList" style="height: 260rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;">材料名称: {{item.materialsName}}</view>
									<view style="flex: 3;">编号: {{item.materialsCode}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;">材料价格: {{item.materialsPices}}</view>
									<view style="flex: 3;">材料数量: {{item.materialsNumber}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;">预计进场时间: {{item.approachTime.substring(0,10)}}</view>
									<view style="flex: 3;">总价格: {{item.payMoneny}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 7;">供应商: {{item.supplierName}}</view>
									<view style="flex: 3;">是否付款: 
									    <u-button style="margin-left: 20rpx;" v-if='item.isnoPay=="否"' type="error" shape="square" size="mini">{{item.isnoPay}}</u-button>
										<u-button style="margin-left: 20rpx;" v-if='item.isnoPay=="是"' type="success" shape="square" size="mini">{{item.isnoPay}}</u-button>
									</view>
								</view>
								
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="menterList.length<=0"></u-empty>
					
						</view>

						<view :class="['材料领用'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']" style="width: 100%;">
							
							
							<view class="tabnav" v-for="item in mrecevieList" style="height: 230rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="padding: 10rpx;">材料名称: {{item.materialsName}}</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;">编号: {{item.materialsNumber}}</view>
									<view style="flex: 1;">联系方式:{{item.tel}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;">领用人: {{item.recipientsPersonName}}</view>
									<view style="flex: 1;">领用时间: {{item.recipientsTime.substring(0,10)}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;">领用数量: {{item.recipientsNumber}}</view>
									<view style="flex: 1;">使用时间: {{item.estimatedTime.substring(0,10)}}</view>
								</view>
								
								
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="mrecevieList.length<=0"></u-empty>
							
							
						</view>

						<view :class="['拍照上传'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']" style="width: 100%;">
							
							<!-- <u-upload ref="uUpload" @on-uploaded="onUploaded" :action="action" :auto-upload="false" ></u-upload>
							<u-button @click="submit">提交</u-button> -->
							<view>
								
								<l-file ref="lFile" @up-success="onSuccess"></l-file>
								
								<view class="padding text-center">
							
									<view class="padding">
										<button @tap="getFile">选择文件</button>
									</view>
									<view class="padding" style="font-size: 26rpx;text-align: center;">
										<text decode>{{tip}}</text>
									</view>
									
									<view 
									style="margin: 0rpx 20rpx 20rpx 20rpx;border-bottom: 1rpx #D9D9D9 solid;display: flex;flex: 10;text-align: center;padding: 20rpx;" 
									v-for="item in tempFilesSead">
										
								        <!-- <view style="flex:3">1</view> -->
										<view style="flex:8;text-align: left;">{{item.name}}</view>
										<view style="flex:2">{{item.size}}</view>
									</view>
									
									<view class="padding">
										<button @tap="getImage">上传</button>
									</view>
									
								</view>
							</view>
							
						</view>

						<view :class="['资源投入'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']" style="width: 100%;">
							<!-- resourceList -->
							<view class="tabnav" v-for="item in resourceList" style="height: 300rpx;width: 100%;margin:20rpx 2px 20rpx 3px">
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">设备名称: {{item.equipmentNameNow}}</view>
									<view style="flex: 1;text-align: right;">编号: {{item.equipmentNo}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">责任人: {{item.responsiblePreson}}</view>
									<view style="flex: 1;text-align: right;">数量: {{item.leaseNum}} {{item.unit}}</view>
								</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">设备型号: {{item.equipmentType}}</view>
									<view style="flex: 1;text-align: right;">位置: {{item.equipmentAddress}}</view>
								</view>
								<view style="padding: 10rpx;">租赁公司: {{item.leaseCompany}}</view>
								<view style="display: flex;padding: 10rpx;">
									<view style="flex: 1;font-size: 30rpx;">检查周期: {{item.checkCycle}}(天)</view>
									<view style="flex: 1;text-align: right;">计价方式: {{item.leasePrice}}/ {{item.priceType}}</view>
								</view>
								
								
							</view>
							
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="resourceList.length<=0"></u-empty>
							
							
							
							
						</view>

						<view :class="['设计变更'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item3,index3) in shejiList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">项目名称: &nbsp;{{item3.projectName}}</view>
										<view class="type">文件上传日期: &nbsp;&nbsp; {{item3.createDate}}</view>
										<view class="type">文件: &nbsp;&nbsp; {{item3.filePath}}</view>
										<view class="type">状态: &nbsp;{{item3.state}}</view>
									</view>
								</view>
							</view> 
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="shejiList.length<=0"></u-empty>
						</view>
						<view :class="['工程形象进度'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item4,index4) in projectImageList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">项目名称: &nbsp;{{item4.projectName}}</view>
										<view class="type">项目节点: &nbsp;&nbsp; {{item4.nodesThat}}</view>
										<view class="type">小标题: &nbsp;&nbsp; {{item4.title}}</view>
										<view class="type">当前完成进度: &nbsp;{{item4.achieveTier}}</view>
									</view>
									
								</view>
							</view>
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="projectImageList.length<=0"></u-empty>
						</view>
						<view :class="['项目人员信息'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item6,index6) in personnelList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">员工姓名: &nbsp;{{item6.name}}</view>
										<view class="type">工程名称: &nbsp;&nbsp; {{item6.project}}</view>
										<view class="type">性别: &nbsp;&nbsp; {{item6.sex}}</view>
										<view class="type">电话: &nbsp;{{item6.phone}}</view>
									</view>
									
								</view>
							</view>
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="personnelList.length<=0"></u-empty>
						</view>
						<view :class="['质量安全进度'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item5,index5) in checkinfoList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">责任人: &nbsp;{{item5.dutyPersonName}}</view>
										<view class="type">检查项: &nbsp;&nbsp; {{item5.remarks}}</view>
										<view class="type">告知人: &nbsp;&nbsp; {{item5.nunciatornamelist}}</view>
										<view class="type">整改状态: &nbsp;{{item5.handingSuggestion}}</view>
									</view>
									
								</view>
							</view>
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="checkinfoList.length<=0"></u-empty>
						</view>
						<view :class="['施工方案报批'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item8,index8) in shengpiList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">项目名称: &nbsp;{{item8.projectName}}</view>
										<view class="type">文件上传日期: &nbsp;&nbsp; {{item8.createDate}}</view>
										<view class="type">文件: &nbsp;&nbsp; {{item8.filePath}}</view>
										<view class="type">状态: &nbsp;{{item8.state}}</view>
									</view>
								</view>
							</view>
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="shengpiList.length<=0"></u-empty>
						</view>
						
						<view :class="['项目进度款'==swiperShowIndex? 'show_view' : 'hide_view','aqzk']">
							<view class="order tabnav " v-for="(item7,index7) in contractManagementList">
								<view class="item" >
									<view class="content">
										<view class="title u-line-2">项目名: &nbsp;{{item7.subordinateProjectName}}</view>
										<view class="type">项目总造价: &nbsp;&nbsp; {{item7.subordinateProjectPrice}}</view>
										<view class="type">合同类型: &nbsp;&nbsp; {{item7.contractType}}</view>
										<view class="type">预计收支金额: &nbsp;{{item7.contractMoney}}</view>
										<view class="type">合同收支类型: &nbsp;{{item7.contrcatIsNone}}</view>
									</view>
									
								</view>
							</view>
							<u-empty :text="projectOne.projectName+': 数据为空!'" mode="list" v-if="contractManagementList.length<=0"></u-empty>
						</view>


					</swiper-item>


				</swiper>
			</view>
			<!--内容-->







		</view>



		<!-- <button @click="closeLunog">测试引导页-清除所有缓存</button> -->



		<view class="index-goods">
			<view class="navBarButtonBox">
				<!-- //顶部右侧菜单 -->
				<view v-if="navBarButton" class="goods_shop_cart_bg navBarButton" @tap="showShopCartBg('nav')"
				 @touchmove.stop.prevent="moveHandleStop"></view>
				<view class="h_newlit" v-bind:class="[navBarButton ? 'active' : '','']">
					<view class="em">
						<view style="font-size: 14px" @tap="navBarButtontO(index)" v-for="(item,index) in userRoleList" :key='index'>
							<!-- <text class="iconfont icon-shouye"></text> -->
							{{item.name}}
						</view>

					</view>
				</view>
			</view>
		</view>





	</view>

</template>

<script>
	import cmdProgress from "@/components/cmd-progress/cmd-progress.vue"
	import swiperNavBar from "../../components/swiperNavBar.vue";
	import lFile from '@/components/l-file/l-file.vue'
	let _this;
	export default {
		components: {
			lFile,
			cmdProgress,
			swiperNavBar
		},
		data() {
			return {
				localPath: '',
				tip: ``,
				tempFilesSead:[], //已经选择的文件
				fileList:[] ,//已经上传的文件
				banners: [],
				msgList: [], //文字轮播
				projcetList: [], //项目集合
				projcetList1: [], //项目集合
				projectOne: {}, //当前项目,点击改变
				host: "", //请求ip地址
				JSESSIONID: "", //请求JSESSIONID值
				userRoleList: {}, //全部角色
				userRoleIndex: 0, //当前角色的index
				src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
				projectSrcList: [],
				navBarButton: false,
                qualityList:[], //质量状况
				safetyList:[], //安全状况
				costList:[], //成本(合同)
				resourceList:[], //资源投入(合同)
				materialsList:[], //材料预警
				menterList:[], //材料进场
				mrecevieList:[], //材料领用
				action: 'http://www.example.com/upload',//上传文件的地址
				filesArr: [],
				
				shejiList:[],
				checkinfoList:[],
				projectImageList:[],
				personnelList:[],
				shengpiList:[],
				contractManagementList:[],
				scrollIntoView: 0, //设置哪个方向可滚动，则在哪个方向滚动到该元素
				swiperTabList: [], //导航列表
				swiperShowIndex: "工程进度", //显示 默认是第一个
				swiperTabIdx: 0,
				swiperColor: '#333333', //导航栏字体未选中前颜色
				swiperCurrentColor: '#1D63FF', //选中当前导航栏字体颜色
				currentSwiperWidth: '25%', //当前导航的宽度 % upx rpx px  （导航超出可左右滑动 ）
				currentSwiperHeight: 80, //当前导航的高度度 rpx px
				mainHeight: 100, //全屏或者局部滑动设置的高度
				currentSwiperLineShow: true, //是否显示导航栏的线条 （线条距离标题太近的话可自行修改.swiperLine的css）
				currentSwiperLineActiveBg: '#1D63FF', //当前选中的导航栏线条颜色
				currentSwiperLineActiveWidth: '60rpx', //当前选中的导航栏线条的宽度 upx rpx px
				currentSwiperLineActiveHeight: '6rpx', //当前选中的导航栏线条的高度度 upx rpx px
				currentSwiperLineAnimatie: true, //当前选中的导航栏线条过渡效果
				//（全屏出现滚动条 去掉paddingTop 但导航栏会遮住部分内容 自行改.swiperCont .swiper里css）
			}
		},
		onLoad() {
			_this = this;

			this.loadBanner();
			this.onShowLun();
			//判断用户角色
			this.userRoleList = uni.getStorageSync('userRoleAll');
			for (var i = 0; i < this.userRoleList.length; i++) {
				//console.log(this.userRoleList[i])
				console.log("enname:"+this.userRoleList[i].enname)
				if (this.userRoleList[i].enname == 'cly') {
					_this.userRoleIndex = i;
				}
				
				if(this.userRoleList[i].enname == 'yzfdb' || this.userRoleList[i].enname == 'jlfdb'){
					this.userRoleIndex = 0;
				}
			}

			if (_this.userRoleList[_this.userRoleIndex].showList.length <= 0) {
				console.log("该角色下没有栏目");
			} else {
				_this.swiperTabList = _this.userRoleList[_this.userRoleIndex].showList;
				console.log("swiperTabList:"+_this.swiperTabList)
				if (_this.userRoleList[_this.userRoleIndex].enname == 'yzfdb'|| this.userRoleList[_this.userRoleIndex].enname == 'jlfdb') {
				_this.swiperShowIndex = _this.swiperTabList[0];
				console.log("swiperShowIndex:"+_this.swiperShowIndex)
				}
				this.getUserInfo();

			}

		},

		onNavigationBarButtonTap: function() {
			this.navBarButton = !this.navBarButton;
			//console.log(this.navBarButton)

		},
       onReady() {
			// 得到整个组件对象，内部图片列表变量为"lists"
			//this.uUpload = this.$refs.uUpload;
		},
		methods: {
			// //上传事件
   //          submit: function(){
			// 	console.log("=========")
			// 	console.log(this.$refs.uUpload)
			// 	this.$refs.uUpload.upload();
			// },
			// onUploaded: function(lists) {
			// 	console.log("=====lists====")
			// 	console.log(lists);
			// 	this.filesArr = lists;
			// 	console.log(this.filesArr)
			// },
			getFile(){
				uni.chooseImage({
					count: 9, //默认9
					sizeType: ['original'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['camera','album'], //从相机、相册选择
					success: (res) => {
						var tempFilePaths = res.tempFiles;//tempFilePaths获取是undefined
						
						for (var i = 0; i < tempFilePaths.length; i++) {
							console.log(tempFilePaths[i])
							let ssize="";
							if(tempFilePaths[i].type=="text/plain"){
								ssize=((tempFilePaths[i].size*4)/1000).toFixed(2)+"kb";
							}else{
								ssize=(tempFilePaths[i].size/1000).toFixed(2)+"kb";
							}
							_this.tempFilesSead.push({
								name:tempFilePaths[i].name,
								size:ssize,
								type:tempFilePaths[i].type,
								path:tempFilePaths[i].path
							});
						}
							//console.log(_this.fileList);
					}
				});
			},
			getImage(){
				uni.showLoading({
				    title: '文件上传中...'
				});
			//	setTimeout(function(){
					let val= uni.getStorageSync("pathHost");
					let value=uni.getStorageSync("JSESSIONID");		
						let fileys="";
					for (var i = 0; i < _this.tempFilesSead.length; i++) {
						 uni.uploadFile({
							url: val + "/ggcapp/sys/file/webupload/upload"+";JSESSIONID="+value+"?__ajax=true&mobileLogin=true&uploadPath=/appFile/",
							filePath: _this.tempFilesSead[i].path,
							name: "file", 
							success(res) {
								let obj=JSON.parse(res.data);
								//console.log(obj)
								if(obj.success){
									_this.fileList.push({
										imgPath: obj.body.url
									})
									fileys=fileys+obj.body.url+"|";
								//	console.log(fileys)	
								}
							}
						 });  
					}
					
					setTimeout(function(){
						//console.log(fileys)
						let sp = fileys.substring(0,fileys.length-1);
						uni.request({
							url: val + "/ggcapp//admissionmaterialst/admissionmaterials/admissionMaterials/save1"+";JSESSIONID="+value+"?__ajax=true&mobileLogin=true",
							data:{
								projectId:_this.projectOne.id,
							   imagePath:sp
							},
							success: (data) => {
								uni.hideLoading();
								uni.showToast({
									title: data.data.msg,
									duration: 2000
								});
								tempFilesSead = [];
								setTimeout(function(){
									uni.navigateBack({
									    delta: 1
									});
									
								},1300);
							}
						});
					},500)
					
			//	},1000)
			},
			onSuccess(res) {
				console.log('上传成功回调',JSON.stringify(res));
				uni.showToast({
					title: JSON.stringify(res),
					icon: 'none'
				})
			},
			//获取栏目信息
			getTyepInfo: function(type) {
			    console.log(_this.projectOne.id)
				if (type == '质量状况') {
					//根据项目id,和type 1 分项 2,日常 查询质量状况
					uni.request({
						url: _this.host + "/ggcapp/qualitycontrols/checkinfoquality/checkInfoQuality/data" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&type=2&projectId=" + _this.projectOne.id + "",
						success(obj) {
							_this.qualityList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 250 * obj.data.rows.length;
							}
						
							_this.qualityList=obj.data.rows
						}
					})
				}
				if (type == '安全状况') {
					//根据项目id,和type 1 分项 2,日常 查询安全状况
					uni.request({
						url: _this.host + "/ggcapp/safetymanagement/checkinfo/checkInfo/data" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&type=2&projectId=" + _this.projectOne.id + "",
						success(obj) {
							//console.log(obj.data.rows)
							_this.safetyList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 250 * obj.data.rows.length;
							}
							_this.safetyList=obj.data.rows
						}
					})
				}
				if (type == '成本') {
					uni.request({
						url: _this.host + "/ggcapp/contractmanagements/contractmanagement/ggContractManagements/data" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&subordinateProject=" + _this.projectOne.id + "&pageSize=1000",
						success(obj) {
							//console.log(obj.data.rows)
							_this.costList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 280 * obj.data.rows.length;
							}
							_this.costList=obj.data.rows
						}
					})
				}
				if (type == '资源投入') {
					uni.request({
						url: _this.host + "/ggcapp/equipmentmanage/leaseparameter/ggLeaseParameter/data" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&projectId=" + _this.projectOne.id + "&pageSize=1000",
						success(obj) {
							//console.log(obj.data.rows)
							_this.resourceList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 350 * obj.data.rows.length;
							}
							_this.resourceList=obj.data.rows
						}
					})
				}
				if (type == '材料预警') {
					uni.request({
						url: _this.host + "/ggcapp/costcontrol/accounting/ggCostAccounting/dataByProjectId" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&projectId=" + _this.projectOne.id + "",
						success(obj) {
							//console.log(obj.data)
							_this.materialsList=[];
							//防止收起不能滑动
							if(obj.data.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 310 * obj.data.length;
							}
							_this.materialsList=obj.data
						}
					})
				}
				if (type == '材料入场') {
					uni.request({
						url: _this.host + "/ggcapp/admissionmaterialst/admissionmaterials/admissionMaterials/dataByPid" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&projectId=" + _this.projectOne.id + "",
						success(obj) {
							//console.log(obj.data.rows)
							_this.menterList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 280 * obj.data.rows.length;
							}
							_this.menterList=obj.data.rows
						}
					})
				}
				if (type == '材料领用') {
					uni.request({
						url: _this.host + "/ggcapp/materialsofrecipientst/materialsofrecipients/materialsOfRecipients/dataByPid" + ";JSESSIONID=" + _this.JSESSIONID +
							"?__ajax=true&mobileLogin=true&projectId=" + _this.projectOne.id + "",
						success(obj) {
							//console.log(obj.data.rows)
							_this.mrecevieList=[];
							//防止收起不能滑动
							if(obj.data.rows.length<=1){
								_this.mainHeight = 700;
							}else{
								_this.mainHeight = 253 * obj.data.rows.length;
							}
							_this.mrecevieList=obj.data.rows
						}
					})
				}

				if(type == '施工方案报批'){
					_this.getShengpiList();
				}

                if(type == '项目进度款'){
					_this.getContractManagementList();
				}

				if(type == '项目人员信息'){
					_this.getPersonnelList();
				}
				
				if(type == '质量安全进度'){
					_this.getCheckinfoList();
				}
				if(type == '工程形象进度'){
					_this.getProjectImage();
				}
				if(type == '设计变更'){
					_this.getSheji();
				}
		},

		//点击项目图片进行切换
		tabProject: function(index) {
			_this.projectOne = _this.projcetList[index];
			/* console.log(_this.projectOne.projectName);
			console.log(_this.projectOne.id); */
			//刷新
			 _this.getMeavn(_this.swiperTabList[_this.swiperTabIdx]);
		},
		//点击角色
		navBarButtontO: function(index) {

			_this.userRoleIndex = index;
			console.log(_this.userRoleList[_this.userRoleIndex].name);
			_this.navBarButton = !_this.navBarButton;
			this.swiperTabIdx = 0;
			this.scrollIntoView = Math.max(0, 0);

			if (_this.userRoleList[_this.userRoleIndex].showList.length <= 0) {
				console.log("该角色下没有栏目");
				_this.swiperTabList = [];
			} else {
				_this.swiperTabList = _this.userRoleList[_this.userRoleIndex].showList;
				_this.getUserInfo();

				// console.log(_this.swiperTabList)
			}

		},
		//点击空白处
		showShopCartBg: function(type) {
			_this.navBarButton = !_this.navBarButton;
		},
		//tab点击事件 自行完善需要的代码
		CurrentTab: function(index, item) {
			this.swiperTabIdx = index;
			this.scrollIntoView = Math.max(0, index - 1);
			_this.swiperShowIndex = item;
			console.log('--点击--'+index+" ---- "+ item)
		},
		//滑动事件  自行完善需要的代码
		SwiperChange: function(e) {
			this.swiperTabIdx = e.detail.current;
			this.scrollIntoView = Math.max(0, e.detail.current - 1);
			// console.log(e)
			// console.log(e.detail)
			console.log("滑动---" + "当前的index:" + e.detail.current + ",名称:" + _this.swiperTabList[e.detail.current]);
			_this.swiperShowIndex = _this.swiperTabList[e.detail.current];

           _this.getMeavn(_this.swiperTabList[_this.swiperTabIdx]);
		

		},
		//根据栏目名称加载数据
		getMeavn: function(name){
			console.log("name:"+name)
			if (name == '工程进度') {
				_this.getUserInfo();
			}
			
			if(name == '项目信息'){
				
				//获取项目信息
				if (_this.userRoleList[_this.userRoleIndex].enname != 'cly') {
					_this.getProjectByRoleName1(_this.userRoleList[_this.userRoleIndex].name)
				} else {
					_this.getProjectAll1();
				}
			}
			
			if (name == '质量状况') {
				_this.getTyepInfo(name);
			}
			if (name == '安全状况') {
				_this.getTyepInfo(name);
			}
			if (name == '成本') {
				_this.getTyepInfo(name);
			}
			if (name == '材料预警') {
				_this.getTyepInfo(name);
			}
			if (name == '材料入场') {
				_this.getTyepInfo(name);
			}
			if (name == '材料领用') {
				_this.getTyepInfo(name);
			}
			if (name == '拍照上传') {
				console.log("拍照上传")
			}
			if (name == '资源投入') {
				_this.getTyepInfo(name);
			}
			if(name == '施工方案报批'){
				_this.getTyepInfo(name);
			}
			
			if(name == '项目进度款'){
				_this.getTyepInfo(name);
			}
			
			if(name == '项目人员信息'){
				_this.getTyepInfo(name);
			}
			
			if(name == '质量安全进度'){
				_this.getTyepInfo(name);
			}
			
			if(name == '工程形象进度'){
				_this.getTyepInfo(name);
			}
			
			if(name == '设计变更'){
				_this.getTyepInfo(name);
			}
		},
		//根据角色获取项目
		getProjectByRoleName: function(roleName) {
			uni.request({
				url: _this.host + "/ggcapp/userprojects/userproject/ggUserProject/findAllByRoleName" + ";JSESSIONID=" + _this.JSESSIONID +
					"?__ajax=true&mobileLogin=true&roleName=" + roleName + "",
				success(dat) {
					_this.projcetList = [];
					_this.mainHeight = 480 * dat.data.length;
					for (var i = 0; i < dat.data.length; i++) {
						_this.projcetList.push({
							id: dat.data[i].id,
							projectStart: dat.data[i].projectStart, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						})
						//console.log(_this.host+dat.data[i].obligate)				
					}
					//console.log(dat.data)
					//默认第一个项目
					_this.projectOne = _this.projcetList[0];
					//console.log(_this.projectOne.projectName);
				}
			});

		},
		//查看全部项目--管理员
		getProjectAll: function() {
			uni.request({
				url: _this.host + "/ggcapp/constructionprojects/constructionproject/ggConstructionProjects/dataAll" +
					";JSESSIONID=" + _this.JSESSIONID + "?__ajax=true&mobileLogin=true&pageSize=9999",
				success(dat) {
					_this.projcetList = [];
					_this.mainHeight = 480 * dat.data.length;
					for (var i = 0; i < dat.data.length; i++) {
						_this.projcetList.push({
							id: dat.data[i].id,
							projectStart: dat.data[i].projectStart, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						})
						//console.log(_this.host+dat.data.list[i].obligate)				
					}
					//console.log(dat)
					//默认第一个项目
					_this.projectOne = _this.projcetList[0];
					//console.log(_this.projectOne.projectName);
				}
			});
		},
		
		//根据角色获取项目
		getProjectByRoleName1: function(roleName) {
			uni.request({
				url: _this.host + "/ggcapp/userprojects/userproject/ggUserProject/findAllByRoleName" + ";JSESSIONID=" + _this.JSESSIONID +
					"?__ajax=true&mobileLogin=true&roleName=" + roleName + "",
				success(dat) {
					_this.projcetList = [];
					_this.projcetList1 = [];
					_this.mainHeight = 480 * dat.data.length;
					for (var i = 0; i < dat.data.length; i++) {
						var startState ="";
						if(dat.data[i].projectStart == 2){
							startState = "在建";
						}else{
							startState = "待建";
						}
						console.log("data:");
						console.log(dat)
						_this.projcetList.push({
							id: dat.data[i].id,
							projectStart: startState, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						})
						_this.projcetList1.push({
							id: dat.data[i].id,
							projectStart: startState, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						})
						//console.log(_this.host+dat.data[i].obligate)				
					}
					//console.log(dat.data)
					//默认第一个项目
					_this.projectOne = _this.projcetList1[0];
					//console.log(_this.projectOne.projectName);
				}
			});
		
		},
		//查看全部项目--管理员
		getProjectAll1: function() {
			uni.request({
				url: _this.host + "/ggcapp/constructionprojects/constructionproject/ggConstructionProjects/dataAll" +
					";JSESSIONID=" + _this.JSESSIONID + "?__ajax=true&mobileLogin=true&pageSize=9999",
				success(dat) {
					_this.projcetList = [];
					_this.projcetList1 = [];
					_this.mainHeight = 480 * dat.data.length;
					for (var i = 0; i < dat.data.length; i++) {
						var startState ="";
						if(dat.data[i].projectStart == 2){
							startState = "在建";
						}else{
							startState = "待建";
						}
						_this.projcetList1.push({
							id: dat.data[i].id,
							projectStart: startState, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						});
						_this.projcetList.push({
							id: dat.data[i].id,
							projectStart: startState, //项目状态
							projectName: dat.data[i].projectName, //项目名称
							projectOverview: dat.data[i].projectOverview, //项目描述
							developmentOrganization: dat.data[i].developmentOrganization, //单位
							createDate: dat.data[i].createDate.substring(0, 10), //创建时间
							updateDate: dat.data[i].updateDate, //创建时间
							percents: Number(((dat.data[i].achieveTier / dat.data[i].numberPlies) * 100).toFixed(0)), //进度
							grossInvestment: dat.data[i].grossInvestment, //预算
							numberPlies: dat.data[i].numberPlies, //总层
							achieveTier: dat.data[i].achieveTier, //已完成
							projectAddress: dat.data[i].projectAddress, //地址
							projectImg: _this.host + dat.data[i].obligate, //图片
							CmpMaintenancetSum: dat.data[i].projectMap.CmpMaintenancetSum, //人员
							unitSum: dat.data[i].projectMap.unitSum //设备
						});
						//console.log(_this.host+dat.data.list[i].obligate)				
					}
					//console.log(dat)
					//默认第一个项目
					_this.projectOne = _this.projcetList1[0];
					//console.log(_this.projectOne.projectName);
				}
			});
		},

		//点击项目名称查看详情
		projceClick: function(id, index) {
			console.log(id);
			uni.navigateTo({
				url: "/pages/projectNavicat/projectNav?itemid=" + JSON.stringify(_this.projcetList[index]),
			})
		},
		//点击导航选项
		tabNavts: function(i) {
			if (i == 1) {
				console.log("通知公告");
				uni.navigateTo({
					url: "/pages/notification/notification"
				})

			}
			if (i == 2) {
				console.log("消息提醒");
				uni.navigateTo({
					url: "/pages/messagetis/messagetis"
				})
			}
			if (i == 3) {
				console.log("待办事宜");
				uni.switchTab({
					url: "/pages/commissiontis/commissiontis"
				})
			}
			if (i == 4) {
				console.log("签到");
				uni.navigateTo({
					url: "/pages/signIns/signIns"
				})
			}
		},
		//首页轮播图数据加载函数
		loadBanner: function() {
			this.banners.push({
				itemid: "1",
				itempic: "../../static/img/lunbo/lunbo1.png"
			}, {
				itemid: "2",
				itempic: "../../static/img/lunbo/lunbo2.png"
			}, {
				itemid: "3",
				itempic: "../../static/img/lunbo/lunbo3.png"
			});

		},
		onShowLun: function(e) {
			this.msgList.push({
				url: "url",
				title: "多地首套房贷利率上浮 热点城市渐迎零折扣时代"
			}, {
				url: "url",
				title: "交了20多年的国内漫游费将取消 你能省多少话费？"
			}, {
				url: "url",
				title: "华为P40系列可可西里自然秘境探索全景记录"
			}, {
				url: "url",
				title: "世卫组织：最糟糕的时刻即将到来"
			}, {
				url: "url",
				title: "B站当学习主播、研发洗手液，华东理工大学化学学院在抗疫中探索“专思创”育人新模式"
			}, {
				url: "url",
				title: "俄总统普京：2月份援助中国200万口罩，目前从中国收到1.5亿只"
			}, {
				url: "url",
				title: "FPX为何引入Khan？德云色分析其原因"
			}, {
				url: "url",
				title: "非遗上直播，让更多古老文化“出圈”"
			}, {
				url: "url",
				title: "四问ETC，卡友关注的这些关键内容啥时候能搞清？"
			}, {
				url: "url",
				title: "武汉出院患者实行“14+14”管理"
			})

		},
		//获取登陆用户信息
		getUserInfo: function() {
			_this.JSESSIONID = uni.getStorageSync("JSESSIONID");
			_this.host = uni.getStorageSync("pathHost");


			//获取项目信息
			if(_this.swiperShowIndex == '项目信息'){
				if (_this.userRoleList[_this.userRoleIndex].enname != 'cly') {
					_this.getProjectByRoleName1(_this.userRoleList[_this.userRoleIndex].name)
				} else {
					_this.getProjectAll1();
				}
			}else{
				if (_this.userRoleList[_this.userRoleIndex].enname != 'cly') {
					_this.getProjectByRoleName(_this.userRoleList[_this.userRoleIndex].name)
				} else {
					_this.getProjectAll();
				}
			}
			

			uni.request({
				url: _this.host + "/ggcapp/sys/user/infoData" + ";JSESSIONID=" + _this.JSESSIONID +
					"?__ajax=true&mobileLogin=true",
				success(data) {
					if (data.data.success != undefined) {
						console.log("请求成功----");
					} else {
						console.log("请求失败----");
						uni.setStorageSync("loginState", false);
						uni.redirectTo({
							url: '/pages/login/login'
						});
					}
					//设置导航栏title
					uni.setNavigationBarTitle({
						title: data.data.body.data.company.name
					});


				},
				fail(data) {
					console.log("请求失败----未登录或登录下线");
					uni.setStorageSync("loginState", false);
					uni.redirectTo({
						url: '/pages/login/login'
					});
				}


			})
		},
//设计变更
		getSheji:function(){
			var projectId = _this.projectOne.id;
			uni.request({
				url: _this.host+"/ggcapp/infoupload/infoupload/ggInfoUpload/getInfoUpload;JSESSIONID="+_this.JSESSIONID+"?pointId=9cbcd6c819e74500b7afe60e7f3f30df&projectId="+projectId,
				success(dat) {
					_this.mainHeight=480*dat.data.length;
					if(dat.data.length <= 0){
						_this.mainHeight= 700;
					}
					_this.shejiList=[];
					for (var i = 0; i < dat.data.length; i++) {
						var valueArray = dat.data[i].filePath.split("|");
						var labelArray = [];
						for(var j =0 ; j<valueArray.length; j++){
							if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(valueArray[i]))
							{
								labelArray[j] = decodeURIComponent(valueArray[j].substring(valueArray[j].lastIndexOf("/")+1)); //"<a href=\""+valueArray[j]+"\" url=\""+valueArray[j]+"\" target=\"_blank\">"+decodeURIComponent(valueArray[j].substring(valueArray[j].lastIndexOf("/")+1))+"</a>"
							}
						}
						
						var value = dat.data[i].state;
						var state = "";
						if(value==1){
							state= "审核中"
						}else if(value==2){
							state = "审核通过"
						}else if(value==3){
							state = "审核未通过"
						}else {
							state = "未设置审核"
						}
						_this.shejiList.push({
							id:dat.data[i].id,
							state:state,//状态
							projectName:dat.data[i].projectName,  //项目名称
							filePath:labelArray.join(" "),//文件路径
							createDate:dat.data[i].createDate.substring(0,10)//创建时间
						});
					}
				}
			});
		},
		//工程形象
		getProjectImage:function(){
			var projectId = _this.projectOne.id;
			uni.request({
				url: _this.host+"/ggcapp/schedulecontrol/schedulecontroimagelist/projectImageProgress/getProjectImageProgressList;JSESSIONID="+_this.JSESSIONID+"?projectId="+projectId,
				success(dat) {
					_this.mainHeight=480*dat.data.length;
					if(dat.data.length <= 0){
						_this.mainHeight= 700;
					}
					_this.projectImageList=[];
					for (var i = 0; i < dat.data.length; i++) {
						var dataHt = "";
						if(isNaN(dat.data[i].achieveTier/dat.data[i].sumTier*100)){
							dataHt+=0+"%"
						}else{
							dataHt+=((dat.data[i].achieveTier/dat.data[i].sumTier*100).toFixed(1)+"%")
						}
						_this.projectImageList.push({
							id:dat.data[i].id,
							projectName:dat.data[i].projectName,  //项目名称
							nodesThat:dat.data[i].nodesThat,//节点
							title:dat.data[i].title,//标题,
							achieveTier:dataHt//进度
						});
					}
				}
			});
		},
		// 发整改（质量安全进度）通知单
		getCheckinfoList:function(){
			var projectId = _this.projectOne.id;
			uni.request({
				url: _this.host+"/ggcapp/safetymanagement/checkinfo/checkInfo/getCheckinfoList;JSESSIONID="+_this.JSESSIONID+"?type=2&projectId="+projectId,
				success(dat) {
					_this.mainHeight=480*dat.data.length;
					if(dat.data.length <= 0){
						_this.mainHeight= 700;
					}
					_this.checkinfoList=[];
					for (var i = 0; i < dat.data.length; i++) {
						_this.checkinfoList.push({
							id:dat.data[i].id,
							remarks:dat.data[i].remarks,//
							handingSuggestion:dat.data[i].handingSuggestion,//
							dutyPersonName:dat.data[i].dutyPersonName,  //
							nunciatornamelist:dat.data[i].nunciatornamelist
						});
					}
				}
			});
		},
		// 项目人员信息
		getContractManagementList:function(){
			var projectId = _this.projectOne.id;
			uni.request({
				url: _this.host+"/ggcapp/contractmanagements/contractmanagement/ggContractManagements/getGgContractManagementsList;JSESSIONID="+_this.JSESSIONID+"?subordinateProject="+projectId,
				success(dat) {
					_this.mainHeight=480*dat.data.length;
					if(dat.data.length <= 0){
						_this.mainHeight= 700;
					}
					_this.contractManagementList=[];
					for (var i = 0; i < dat.data.length; i++) {
						var contractType = Number(dat.data[i].contractType);
						var start="";
						if(contractType ==1){
							start ="总承包合同";
						}else if(contractType ==2){
							start = "劳务分包合同";
						}else if(contractType ==3){
							start = "专业分包合同";
						}else if(contractType ==4){
							start = "材料采购合同";
						}else if(contractType ==5){
							start = "项目合同";
						}else if(contractType ==6){
							start = "主合同";
						}else if(contractType ==7){
							start = "补充合同";
						}
						
						var contrcatIsNone = Number(dat.data[i].contrcatIsNone);
						var start1="";
						if(contrcatIsNone ==1){
							start1 ="收入";
						}else if(contrcatIsNone ==2){
							start1 = "支出";
						}
						_this.contractManagementList.push({
							id:dat.data[i].id,
							contractType:start,  //
							contrcatIsNone:start1,
							contractMoney:dat.data[i].contractMoney,
							subordinateProjectName:dat.data[i].subordinateProjectName,//
							subordinateProjectPrice:dat.data[i].subordinateProjectPrice//
						});
					}
				}
			});
		},
		// 项目进度款
		getPersonnelList:function(){
			var projectId = _this.projectOne.id;
			uni.request({
				url: _this.host+"/ggcapp/cmpinfomanage/peoplemanage/ggCmpMaintenance/getPersonnel;JSESSIONID="+_this.JSESSIONID+"?project="+projectId,
				success(dat) {
					_this.mainHeight=480*dat.data.length;
					if(dat.data.length <= 0){
						_this.mainHeight= 700;
					}
					_this.personnelList=[];
					for (var i = 0; i < dat.data.length; i++) {
						var dataHt = "";
						if(dat.data[i].sex == 1){
							dataHt+="男"
						}else{
							dataHt+="女"
						}
						_this.personnelList.push({
							id:dat.data[i].id,
							name:dat.data[i].name,//
							project:dat.data[i].project,//
							sex:dataHt,  //
							phone:dat.data[i].phone
						});
					}
				}
			});
		},
		getShengpiList:function(){
					var projectId = _this.projectOne.id;
					uni.request({
						url: _this.host+"/ggcapp/infoupload/infoupload/ggInfoUpload/getInfoUpload;JSESSIONID="+_this.JSESSIONID+"?pointId=bb9598a5d4cd458fa9502bc59d2617d4&projectId="+projectId,
						success(dat) {
							_this.mainHeight=480*dat.data.length;
							if(dat.data.length <= 0){
								_this.mainHeight= 700;
							}
							_this.shengpiList=[];
							for (var i = 0; i < dat.data.length; i++) {
								var valueArray = dat.data[i].filePath.split("|");
								var labelArray = [];
								for(var j =0 ; j<valueArray.length; j++){
									if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(valueArray[i]))
									{
										labelArray[j] = decodeURIComponent(valueArray[j].substring(valueArray[j].lastIndexOf("/")+1)); //"<a href=\""+valueArray[j]+"\" url=\""+valueArray[j]+"\" target=\"_blank\">"+decodeURIComponent(valueArray[j].substring(valueArray[j].lastIndexOf("/")+1))+"</a>"
									}
								}
								
								var value = dat.data[i].state;
								var state = "";
								if(value==1){
									state= "审核中"
								}else if(value==2){
									state = "审核通过"
								}else if(value==3){
									state = "审核未通过"
								}else {
									state = "未设置审核"
								}
								_this.shengpiList.push({
									id:dat.data[i].id,
									state:state,//状态
									projectName:dat.data[i].projectName,  //项目名称
									filePath:labelArray.join(" "),//文件路径
									createDate:dat.data[i].createDate.substring(0,10)//创建时间
								});
							}
						}
					});
				},
		closeLunog: function() {
			uni.showModal({
				title: '清除launchFlag值',
				content: '确定要清除launchFlag值，进行重启测试？',
				success: function(res) {
					if (res.confirm) {
						console.log('用户点击确定');
						// 清除缓存
						uni.clearStorage();
						// 两秒后重启
						// #ifdef APP-PLUS
						uni.showToast({
							icon: 'none',
							duration: 3000,
							title: '清除成功2秒后重启'
						});
						setTimeout(function() {
							uni.hideToast();
							plus.runtime.restart();
						}, 2000);
						// #endif
						// 两秒后跳转
						// #ifdef H5 || MP-WEIXIN
						uni.showToast({
							icon: 'none',
							duration: 3000,
							title: '清除成功2秒后刷新'
						});
						setTimeout(function() {
							uni.navigateTo({
								url: '/pages/index/indexNew'
							});
						}, 2000);

						// #endif
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
				}
			});
		}


	}
	}
</script>

<style lang="scss" scoped>
	@import '../../static/css/index.css';

	page {
		background-color: white;
	}

    .bigshow{
		transform: scale(1.2);
	}
	.smainshow{
		transform: scale(1);
	}

	.hide_view {
		display: none;
	}

	.show_view {
		display: inline-block;
	}

	.u-avaimg {
		margin-left: 20rpx;
		margin-top: 20rpx;
		margin-bottom: 20rpx;
	}
	
	.upload-hidden{
	  display:none;
	}

.upload-bolck{
	display: flex;
}

	.tabnav {
		box-shadow: 0px 0px 12px #BBBBBB;
		border-radius: 15rpx;
	}

	.tabnav2 {
		/* box-shadow: 0px 0px 30rpx rgb(228, 237, 255); */
		box-shadow: 0rpx 0rpx 20rpx #71B6F7;
	}


	.index-content {
		background: white;

	}

	.navts {
		// background-color: #00B26A;
		height: 120rpx;
		width: 100%;
		display: flex;
		flex: 8;
		margin-top: 10rpx;
	}

	.navts-v {
		flex: 2;
		text-align: center;
		/* border: 1px solid red; */
		display: flex;
		flex-direction: column;
	}

	.navts-v-v {
		flex: 1;
		// color: red;
		font-family: "微软雅黑";
		font-size: 22rpx;

	}

	.navts-v-v:nth-of-type(1) {
		font-size: 50rpx;
		color: red;
		font-weight: bolder;
	}

	.projectDeclare {
		text-align: left;
		padding-left: 16rpx;
		font-size: 30rpx;
		font-weight: bold;
	}

	.projectView {
		// padding: 16rpx;
		width: 100%;
		height: 100%;
	}

	.projectView-t {
		display: flex;
		flex: 9;
		height: 350rpx;
		/* background-color: #00B26A; */
		/* border: 1px solid #D6D6D6; */
		border-radius: 15rpx;
		flex-direction: column;
		text-align: center;
		margin-bottom: 30rpx;
		padding: 0 30rpx 0 30rpx;
	}

	.projectView-t-img {
		flex: 6;
		display: flex;
		flex-direction: column;


	}

	.projectView-t-img>image {
		width: 100%;
		height: 100%;
		border-radius: 15rpx;
	}

	.projectView-t-content2 {
		flex: 3;
		line-height: 110rpx;
		display: flex;

	}

	.projectView-t-content {
		flex: 3;
		line-height: 110rpx;
		display: flex;

	}

	.projectView-t-content-name {
		flex: 1;
		text-align: left;
		padding-left: 10rpx;
	}

	.projectView-t-content-time {
		flex: 1;
		text-align: right;
		padding-right: 10rpx;
	}

	/* 文字轮播 */
	.swiper_container {
		/* background-color: #e7e6e6; */
		height: 80rpx;
		width: 100%;
	}

	.swiper_item {
		font-size: 30rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* 滑动切换的 */

	.order {
		width: 710rpx;
		background-color: #ffffff;
		margin: 20rpx auto;
		border-radius: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		font-size: 28rpx;

		.top {
			display: flex;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.store {
					margin: 0 10rpx;
					font-size: 32rpx;
					font-weight: bold;
				}
			}

			.right {
				//color: $u-type-warning-dark;
			}
		}

		.item {
			display: flex;
			margin: 20rpx 0 0;

			.left {
				margin-right: 20rpx;

				image {
					width: 200rpx;
					height: 200rpx;
					border-radius: 10rpx;
				}
			}

			.content {
				.title {
					font-size: 28rpx;
					line-height: 50rpx;
				}

				.type {
					margin: 10rpx 0;
					font-size: 24rpx;
					color: $u-tips-color;
				}

				.delivery-time {
					color: $u-tips-color;
					font-size: 24rpx;
				}
			}

			.right {
				margin-left: 10rpx;
				padding-top: 20rpx;
				text-align: right;

				.decimal {
					font-size: 24rpx;
					margin-top: 4rpx;
				}

				.number {
					color: $u-tips-color;
					font-size: 24rpx;
				}
			}
		}

		.total {
			margin-top: 20rpx;
			text-align: right;
			font-size: 24rpx;

			.total-price {
				font-size: 32rpx;
			}
		}

		.bottom {
			display: flex;
			margin-top: 40rpx;
			padding: 0 10rpx;
			justify-content: space-between;
			align-items: center;

			.btn {
				line-height: 52rpx;
				width: 160rpx;
				border-radius: 26rpx;
				border: 2rpx solid $u-border-color;
				font-size: 26rpx;
				text-align: center;
				color: $u-type-info-dark;
			}

			.evaluate {
				color: $u-type-warning-dark;
				border-color: $u-type-warning-dark;
			}
		}
	}

	.centre {
		text-align: center;
		margin: 200rpx auto;
		font-size: 32rpx;

		image {
			width: 164rpx;
			height: 164rpx;
			border-radius: 50%;
			margin-bottom: 20rpx;
		}

		.tips {
			font-size: 24rpx;
			color: #999999;
			margin-top: 20rpx;
		}

		.btn {
			margin: 80rpx auto;
			width: 200rpx;
			border-radius: 32rpx;
			line-height: 64rpx;
			color: #ffffff;
			font-size: 26rpx;
			background: linear-gradient(270deg, rgba(249, 116, 90, 1) 0%, rgba(255, 158, 1, 1) 100%);
		}
	}
</style>
